package org.easy.db;

/**
 * SQL
 * @author wuxueli
 */
public interface Sql {

    /**
     * 根据数据库获取查找表名的SQL
     * @param dataBase 数据库
     * @return String
     */
    String tableNameSql(String dataBase);

    /**
     * 根据表名获取表字段查询SQL
     * @param tableName 表名
     * @return String
     */
    String tableColumnSql(String tableName);

    interface Mysql {

        String TABLE_NAME_SQL = "select table_name from information_schema.tables where table_schema='%s'";

        String TABLE_COLUMN_SQL = "select COLUMN_NAME as columnName,DATA_TYPE as dataType,COLUMN_KEY as columnKey,COLUMN_COMMENT as columnComment,EXTRA as extra from information_schema.COLUMNS where table_name='%s'";

    }

    interface Oracle {

        String TABLE_NAME_SQL = "";

        String TABLE_COLUMN_SQL = "";

    }

    interface SqlServer {

        String TABLE_NAME_SQL = "";

        String TABLE_COLUMN_SQL = "";

    }

    interface PostgreSql {

        String TABLE_NAME_SQL = "";

        String TABLE_COLUMN_SQL = "";

    }

    interface Dm {

        String TABLE_NAME_SQL = "";

        String TABLE_COLUMN_SQL = "";

    }

    interface MongoDb {

        String TABLE_NAME_SQL = "";

        String TABLE_COLUMN_SQL = "";

    }
}
